import React, { useEffect, useState } from 'react';
import RCodeEditor from '@/components/RCodeEditor';
import styles from './index.css';
import { code } from '@/components/demo';

const options = {
  lineNumbers: true,
  mode: 'sql',
  lineWrapping: true, // 自动换行
  value: code,
};
export default function() {
  const [editor, setEditor] = useState();
  return (
    <div className={styles.editorRoot}>
      <RCodeEditor options={options} onLoad={setEditor} />
    </div>
  );
}
